<?php $this->load->view('admin/_begin') ?>
<?php $this->load->view('admin/' . $this->router->fetch_class() . '/_filter') ?>
<form accept-charset="utf-8" method="post" action="<?php echo site_url('admin/' . $this->router->fetch_class() . '/action') ?>">	
  <div id="filter-stage" style="display: block;">	
    <table border="0" class="table-list">
      <thead>
        <tr>
          <th class="align-center" with="30">
            <input type="checkbox" class="check-all" value="" name="action_to_all">
          </th>
          <th><?php echo $this->lang->line("label.end_user.avatar") ?></th>
          <th><?php echo $this->lang->line("label.end_user.user_id") ?></th>
          <th><?php echo $this->lang->line("label.end_user.address") ?></th>
          <th><?php echo $this->lang->line("label.end_user.phone") ?></th>
          <th><?php echo $this->lang->line("label.end_user.email") ?></th>
          <th><?php echo $this->lang->line("label.end_user.status") ?></th>          
          <th></th>
        </tr>
      </thead>
      <tbody>
        <?php if (empty($objects)) { ?>
          <tr>
            <td colspan="7">
              <div class="no_data"><?php echo  $this->lang->line('label.empty.data', $this->lang->line('label.' . $this->router->fetch_class() . 's')) ?></div>
            </td>
          </tr>
        <?php } foreach ($objects as $obj) { ?>
          <tr>
            <td class="align-center">
              <input type="checkbox" value="<?php echo $obj['id'] ?>" name="action_to[]">
            </td>
            <td>
              <a href="<?php echo site_url('admin/' . $this->router->fetch_class() . '/show/' . $obj['id']) ?>">
                <img width="80px" src="<?php echo site_url('admin/' . 'file_upload/get_img_from_path?path=' .
                $this->router->fetch_class() . '/' . $obj['avatar']) ?>" alt="avatar"/>
              </a>
            </td>
            <td>
              <a href="<?php echo site_url('admin/' . $this->router->fetch_class() . '/show/' . $obj['id']) ?>">
                <?php echo $this->user_model->to_string($obj["user_id"]) ?>
              </a>
            </td>
            <td>
              <?php echo $obj["address"] ?>
            </td>
            <td>
              <?php echo $obj["phone"] ?>
            </td>
            <td>
              <a href="<?php echo site_url('admin/' . $this->router->fetch_class() . '/show/' . $obj['id']) ?>">
                <?php echo $obj["email"] ?>
              </a>
            </td>
            <td>
              <?php
              $status_array = array(
                  PROFILE_STATUS_BLOCK => $this->lang->line('label.profile.status.block'),
                  PROFILE_STATUS_ACTIVE => $this->lang->line('label.profile.status.active'),
                  PROFILE_STATUS_UNACTICE => $this->lang->line('label.profile.status.unactive'));
              echo @$status_array[$obj['status']];
              ?>
            </td>            
            <td class="actions" style="width: 150px">
              <a class="btn orange edit" href="<?php echo site_url('admin/' . $this->router->fetch_class() . '/edit/' . $obj['id']) ?>"
                 style="margin-left: 5px">
                   <?php echo $this->lang->line('btn.edit') ?>
              </a>
              <a class="confirm btn red delete" href="<?php echo site_url('admin/' . $this->router->fetch_class() . '/delete/' . $obj['id']) ?>"
                 style="margin-left: 5px">
                <?php echo $this->lang->line('btn.delete') ?></a>					
            </td>
          </tr>
        <?php } ?>
      </tbody>
    </table><div class="paging"><?php echo $paging ?></div>
  </div>  
  <div class="table_action_buttons">
    <button class="btn blue confirm" value="active" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.active.profile') ?></span>
    </button>
    <button class="btn orange confirm" value="block" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.block.profile') ?></span>
    </button>
    <button class="btn red confirm" value="delete" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.delete') ?></span>
    </button>
  </div>
</form>
<?php $this->load->view('admin/_end') ?>